#pragma warning(disable:4996)
#pragma warning(disable:6031)

#include <stdio.h>
#include <stdlib.h>

typedef struct list
{
	int n;
	struct list* next;
}list;

void print(list* phead)
{
	list* p = phead;
	while (p != NULL)
	{
		printf("%d ", p->n);
		p = p->next;
	}
}

list* buy(int n)
{
	list* newnode = (list*)malloc(sizeof(list));
	if (newnode == NULL)
	{
		exit(-1);
	}
	newnode->next = NULL;
	newnode->n = n;
	return newnode;
}

void push(list** pphead, int n)
{
	list* newnode = buy(n);
	if (*pphead == NULL)
	{
		*pphead = newnode;
	}
	else
	{
		list* p = *pphead;
		while (p->next != NULL)
		{
			p = p->next;
		}
		p->next = newnode;
	}
}

void fun1(list** pphead)
{
	list* p1 = *pphead;
	if (p1 == NULL || p1->next == NULL)
	{
		return;
	}
	list* p2 = p1->next;
	p1->next = p2->next;
	p2->next = p1;
	*pphead = p2;
	while (p1->next->next != NULL)
	{
		p2 = p1;
		p1 = p1->next;
	}
	p2->next = p1->next;
	p2->next->next = p1;
	p1->next = NULL;
}

int main()
{
	list* p = NULL;
	int n = 0;
	scanf("%d", &n);
	while (n--)
	{
		int num = 0;
		scanf("%d", &num);
		push(&p, num);
	}
	fun1(&p);
	print(p);
	return 0;
}